package com.mxpio.erp.common.purchase.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mxpio.erp.common.jpa.model.NoticeLine;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_PURC_NOTICE_LINE")
@Schema(description="收货通知单行")
public class ReceivingNoticeLine extends NoticeLine {

	private static final long serialVersionUID = 1L;

    @Schema(description = "采购订单行号")
    @Column(name = "PURCHASE_ORDER_LINE_NO_")
    private String purchaseOrderLineNo;

    @Column(name = "ITEM_CODE_")
    @Schema(description = "物料编码")
    private String itemCode ;

    @Column(name = "ITEM_NAME_")
    @Schema(description = "物料名称")
    private String itemName ;

    @Column(name = "ITEM_SPEC_")
    @Schema(description = "规格型号")
    private String itemSpec ;

    @Column(name = "MATERIAL_STANDARD_")
    @Schema(description = "材料标准")
    private String materialStandard ;

    @Column(name = "MATERIAL_MARK_")
    @Schema(description = "材料牌号")
    private String materialMark ;

    @Column(name = "UNIT_CODE_")
    @Schema(description = "单位编号")
    private String unitCode;

    @Column(name = "MAX_RECEIVING_")
    @Schema(description = "最大收货数")
    private BigDecimal maxReceiving;

    @Column(name = "PURCHASE_QUANTITY_")
    @Schema(description = "采购总数量")
    private BigDecimal purchaseQuantity;

    @Transient
    @Schema(description = "实际收货数")
    private BigDecimal actualReceiving;

    @Transient
    @Schema(description = "计划收货数")
    private BigDecimal planedReceiving;

    @Transient
    @Schema(description = "计划退货数")
    private BigDecimal planedReturns;

    @Column(name = "BATCH_")
    @Schema(description = "生产批次")
    private String batch ;

    @Column(name = "MANUFACTURE_DATE_")
    @Schema(description = "生产日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date manufactureDate ;

    @Column(name = "MEMO_")
    @Schema(description = "备注")
    private String memo;
}
